home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / usr / share / hplip / ui4 / systrayframe.pyc (.txt) < prev    next >
Python Compiled Bytecode  |  2009-10-28  |  6KB  |  130 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.6)
  3.  
  4. from base.g import *
  5. from base.codes import *
  6. from ui_utils import *
  7. from PyQt4.QtCore import *
  8. from PyQt4.QtGui import *
  9.  
  10. class SystrayFrame(QFrame):
  11.     
  12.     def __init__(self, parent):
  13.         QFrame.__init__(self, parent)
  14.  
  15.     
  16.     def initUi(self, systray_visible, polling, polling_interval, device_list, systray_messages):
  17.         self.systray_visible = systray_visible
  18.         self.polling = polling
  19.         self.polling_interval = polling_interval
  20.         self.device_list = device_list
  21.         self.systray_messages = systray_messages
  22.         self.gridlayout = QGridLayout(self)
  23.         self.frame = QFrame(self)
  24.         self.frame.setFrameShape(QFrame.StyledPanel)
  25.         self.frame.setFrameShadow(QFrame.Raised)
  26.         self.gridlayout1 = QGridLayout(self.frame)
  27.         self.groupBox_2 = QGroupBox(self.frame)
  28.         self.gridlayout2 = QGridLayout(self.groupBox_2)
  29.         self.ShowAlwaysRadioButton = QRadioButton(self.groupBox_2)
  30.         self.gridlayout2.addWidget(self.ShowAlwaysRadioButton, 0, 0, 1, 1)
  31.         self.HideWhenInactiveRadioButton = QRadioButton(self.groupBox_2)
  32.         self.gridlayout2.addWidget(self.HideWhenInactiveRadioButton, 1, 0, 1, 1)
  33.         self.HideAlwaysRadioButton = QRadioButton(self.groupBox_2)
  34.         self.gridlayout2.addWidget(self.HideAlwaysRadioButton, 2, 0, 1, 1)
  35.         self.gridlayout1.addWidget(self.groupBox_2, 0, 0, 1, 1)
  36.         self.groupBox_3 = QGroupBox(self.frame)
  37.         self.gridlayout3 = QGridLayout(self.groupBox_3)
  38.         self.label_2 = QLabel(self.groupBox_3)
  39.         self.gridlayout3.addWidget(self.label_2, 0, 0, 1, 1)
  40.         self.MessageShowComboBox = QComboBox(self.groupBox_3)
  41.         self.gridlayout3.addWidget(self.MessageShowComboBox, 1, 0, 1, 1)
  42.         self.MessageShowComboBox.addItem(self._SystrayFrame__tr('All'), QVariant(SYSTRAY_MESSAGES_SHOW_ALL))
  43.         self.MessageShowComboBox.addItem(self._SystrayFrame__tr('Errors and Warnings'), QVariant(SYSTRAY_MESSAGES_SHOW_ERRORS_AND_WARNINGS))
  44.         self.MessageShowComboBox.addItem(self._SystrayFrame__tr('Errors Only'), QVariant(SYSTRAY_MESSAGES_SHOW_ERRORS_ONLY))
  45.         self.MessageShowComboBox.addItem(self._SystrayFrame__tr('None'), QVariant(SYSTRAY_MESSAGES_SHOW_NONE))
  46.         spacerItem = QSpacerItem(20, 40, QSizePolicy.Minimum, QSizePolicy.Minimum)
  47.         self.gridlayout3.addItem(spacerItem, 2, 0, 1, 1)
  48.         self.gridlayout1.addWidget(self.groupBox_3, 0, 1, 1, 1)
  49.         self.MonitorGroupBox = QGroupBox(self.frame)
  50.         self.MonitorGroupBox.setCheckable(True)
  51.         self.MonitorGroupBox.setEnabled(False)
  52.         self.gridlayout4 = QGridLayout(self.MonitorGroupBox)
  53.         self.label = QLabel(self.MonitorGroupBox)
  54.         self.gridlayout4.addWidget(self.label, 0, 0, 1, 1)
  55.         self.listWidget = QListWidget(self.MonitorGroupBox)
  56.         self.gridlayout4.addWidget(self.listWidget, 1, 0, 1, 1)
  57.         self.gridlayout1.addWidget(self.MonitorGroupBox, 1, 0, 1, 2)
  58.         self.gridlayout.addWidget(self.frame, 0, 0, 1, 1)
  59.         self.setWindowTitle(QApplication.translate('self', 'self', None, QApplication.UnicodeUTF8))
  60.         self.groupBox_2.setTitle(QApplication.translate('self', 'System tray icon visibility', None, QApplication.UnicodeUTF8))
  61.         self.ShowAlwaysRadioButton.setText(QApplication.translate('self', 'Always show', None, QApplication.UnicodeUTF8))
  62.         self.HideWhenInactiveRadioButton.setText(QApplication.translate('self', 'Hide when inactive', None, QApplication.UnicodeUTF8))
  63.         self.HideAlwaysRadioButton.setText(QApplication.translate('self', 'Always hide', None, QApplication.UnicodeUTF8))
  64.         self.groupBox_3.setTitle(QApplication.translate('self', 'System tray icon messages', None, QApplication.UnicodeUTF8))
  65.         self.label_2.setText(QApplication.translate('self', 'Messages to show:', None, QApplication.UnicodeUTF8))
  66.         self.MonitorGroupBox.setTitle(QApplication.translate('self', 'Monitor button presses on devices', None, QApplication.UnicodeUTF8))
  67.         self.label.setText(QApplication.translate('self', 'Devices to monitor:', None, QApplication.UnicodeUTF8))
  68.         self.connect(self.ShowAlwaysRadioButton, SIGNAL('clicked(bool)'), self.ShowAlwaysRadioButton_clicked)
  69.         self.connect(self.HideWhenInactiveRadioButton, SIGNAL('clicked(bool)'), self.HideWhenInactiveRadioButton_clicked)
  70.         self.connect(self.HideAlwaysRadioButton, SIGNAL('clicked(bool)'), self.HideAlwaysRadioButton_clicked)
  71.         self.connect(self.MessageShowComboBox, SIGNAL('activated(int)'), self.MessageShowComboBox_activated)
  72.  
  73.     
  74.     def updateUi(self):
  75.         self.updateVisibility()
  76.         self.updateMessages()
  77.         self.updateDeviceList()
  78.  
  79.     
  80.     def updateVisibility(self):
  81.         if self.systray_visible == SYSTRAY_VISIBLE_SHOW_ALWAYS:
  82.             self.ShowAlwaysRadioButton.setChecked(True)
  83.         elif self.systray_visible == SYSTRAY_VISIBLE_HIDE_WHEN_INACTIVE:
  84.             self.HideWhenInactiveRadioButton.setChecked(True)
  85.         else:
  86.             self.HideAlwaysRadioButton.setChecked(True)
  87.  
  88.     
  89.     def ShowAlwaysRadioButton_clicked(self, b):
  90.         if b:
  91.             self.systray_visible = SYSTRAY_VISIBLE_SHOW_ALWAYS
  92.         
  93.  
  94.     
  95.     def HideWhenInactiveRadioButton_clicked(self, b):
  96.         if b:
  97.             self.systray_visible = SYSTRAY_VISIBLE_HIDE_WHEN_INACTIVE
  98.         
  99.  
  100.     
  101.     def HideAlwaysRadioButton_clicked(self, b):
  102.         if b:
  103.             self.systray_visible = SYSTRAY_VISIBLE_HIDE_ALWAYS
  104.         
  105.  
  106.     
  107.     def updateMessages(self):
  108.         i = self.MessageShowComboBox.findData(QVariant(self.systray_messages))
  109.         if i != -1:
  110.             self.MessageShowComboBox.setCurrentIndex(i)
  111.         
  112.  
  113.     
  114.     def MessageShowComboBox_activated(self, i):
  115.         sender = self.sender()
  116.         (mode, ok) = sender.itemData(i).toInt()
  117.         if ok:
  118.             self.systray_messages = mode
  119.         
  120.  
  121.     
  122.     def updateDeviceList(self):
  123.         pass
  124.  
  125.     
  126.     def __tr(self, s, c = None):
  127.         return QApplication.translate('SystrayFrame', s, c, QApplication.UnicodeUTF8)
  128.  
  129.  
  130.